package com.lwm.mapper;

import com.lwm.domain.SalesReturnDetail;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SalesReturnDetailMapper {
    /**
     * 插入
     *
     * @param salesReturnDetail 销售退货详细信息
     * @return {@link Integer}
     */
    Integer insert(SalesReturnDetail salesReturnDetail);

    /**
     * 删除一批
     *
     * @param ids ids
     * @return {@link Integer}
     */
    Integer removeBatch(List<Long> ids);

    /**
     * 更新
     *
     * @param salesReturnDetail 销售退货详细信息
     * @return {@link Integer}
     */
    Integer update(SalesReturnDetail salesReturnDetail);

    /**
     * 更具id获取
     *
     * @param id 编码
     * @return {@link SalesReturnDetail}
     */
    @Select("select * from sales_return_detail where id = #{id} ;")
    SalesReturnDetail getById(Long id);

    /**
     * 删除一批通过销售额回来编码
     *
     * @param ids ids
     * @return {@link Integer}
     */
    Integer removeBatchBySalesReturnId(List<Long> ids);

    /**
     * 收到通过销售额回来编码
     *
     * @param id 编码
     * @return {@link SalesReturnDetail}
     */
    @Select("select * from sales_return_detail where sales_return_id = #{id};")
    SalesReturnDetail getBySalesReturnId(Long id);
}
